# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer:
pkgname=py3-elftools
_pkgname=py${pkgname##py3-}
pkgver=0.26
pkgrel=0
pkgdesc="Parsing ELF and DWARF in Python"
url="https://github.com/eliben/pyelftools"
arch="noarch"
license="Unlicense"
depends="python3 py3-setuptools"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/eliben/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	python3 test/run_all_unittests.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	install -m644 README.rst CHANGES \
		"$pkgdir"/usr/share/doc/$pkgname/doc
}

sha512sums="dd166f56654592f6a0d7a91bc41c01b9300de6d2f08b204a61ac48eb3f4b3224f89271c5fe66adc41d71a5e2bed8ddfa4ad495098df917623f7aa90c2caffeca  py3-elftools-0.26.tar.gz"
